
 
#include "stm8lrtc_module.h"

RTC_TimeTypeDef  RTC_TimeStruct;
RTC_InitTypeDef  RTC_InitStruct;
RTC_DateTypeDef  RTC_DateStruct;
 
ErrorStatus   serror;

#ifdef DEBUG
 RTC_WakeUpClock_RTCCLK_Div16    = ((uint8_t)0x00), /*!< (RTC clock) div 16*/
  RTC_WakeUpClock_RTCCLK_Div8     = ((uint8_t)0x01), /*!< (RTC clock) div 8*/
  RTC_WakeUpClock_RTCCLK_Div4     = ((uint8_t)0x02), /*!< (RTC clock) div 4*/
  RTC_WakeUpClock_RTCCLK_Div2     = ((uint8_t)0x03), /*!< (RTC clock) div 2*/
  RTC_WakeUpClock_CK_SPRE_16bits  = ((uint8_t)0x04), /*!< CK SPRE with a counter from 0x0000 to 0xFFFF*/
  RTC_WakeUpClock_CK_SPRE_17bits  = ((uint8_t)0x06)  /*!< CK SPRE with a counter from 0x10000 to 0x1FFFF*/
#endif

void  RTC_MODULE_Format (  CLK_RTCCLKSource_TypeDef   clksource )
{
  RTC_WakeUpClockConfig(RTC_WakeUpClock_RTCCLK_Div16 );
 
  
}
@inline 
u8	HEX(u8 Data)
{
	return ((Data)-(((Data)/16)*6));
}

@inline 
u8	BCD(u8 Data)
{ 
	return ((Data)+(((Data)/10)*6));
}
 